'''
产品页面
'''

from selenium.webdriver.common.by import By
from page.base_page import BasePage

class ProductPage(BasePage):
    url="/crm/index.php?m=product"

    #定位器
    add_product_btn_locator=(By.CSS_SELECTOR,"body > div.container > div.row > div:nth-child(2) > div.pull-right > a")
    table_element_locator=(By.CSS_SELECTOR,"#form1 > table > tbody")
    def click_add_product_btn(self):
        '''点击添加产品按钮'''
        self.driver.find_element(*self.add_product_btn_locator).click()


    def get_table_element(self):
        '''获取产品列表表格对象'''
        return self.driver.find_element(*self.table_element_locator)
